package com.canbot.u05.activity.eat;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.canbot.u05.R;
import com.canbot.u05.activity.BaseActivityNoTitle;
import com.canbot.u05.bean.guide.MapVoiceAndEyes;

/**
 * Created by zmp on 2017/11/20.
 * 充电标记提示界面
 */

public class EatMarkHintOneActivity extends BaseActivityNoTitle implements View.OnClickListener {


        private Button backBt;

        private Button okBt;

        private TextView titleTv;

        private int index;

        private ImageView imageView;

        @Override
        protected void onCreate(@Nullable Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_eat_mark_hinit);
                initView();
        }


        private void initView() {
                MapVoiceAndEyes.playMapVoiceAndEyes(MapVoiceAndEyes.voiceEyesList.get(12));
                index = 0;
                titleTv = (TextView) findViewById(R.id.guide_base_title_tv);
                titleTv.setText("安装充电桩");
                backBt = (Button) findViewById(R.id.eat_bt_back);
                imageView = (ImageView) findViewById(R.id.eat_hint_iv);
                okBt = (Button) findViewById(R.id.eat_hint_bt_ok);
                okBt.setText("安装完成");
                backBt.setOnClickListener(this);
                okBt.setOnClickListener(this);

        }

        @Override
        public void onClick(View v) {
                switch (v.getId()) {
                        case R.id.eat_bt_back:
                                if (index == 1) {
                                        index = 0;
                                        titleTv.setText("安装充电桩");
                                        okBt.setText("安装完成");
                                        imageView.setImageResource(R.drawable.schematic);
                                }
                                else {
                                        finish();
                                }
                                break;
                        case R.id.eat_hint_bt_ok:
                                if (index == 0) {
                                        index = 1;
                                        titleTv.setText("标记充电点");
                                        okBt.setText("完成");
                                        imageView.setImageResource(R.drawable.schematic2);
                                        MapVoiceAndEyes.playMapVoiceAndEyes(MapVoiceAndEyes.voiceEyesList.get(13));
                                }
                                else {
                                        startActivity(new Intent(this, EatMarkActivity.class));
                                        finish();
                                }

                                break;
                }
        }

}
